var sass = require('sass');
var path = require('path');
var fs = require("fs");

// sass.render({file: path.resolve(__dirname , "./scss.scss")}, function(err, result) {
//       // console.log(result);
//       // 把编译好的结果,放在对应的文件之中;
//       fs.writeFile("test.css", result.css ,function(){

//       });
// });
 
// OR 同步方法这样使用也可以;

var result =sass.renderSync({file:path.resolve(__dirname,"./scss.scss")});
fs.writeFileSync("test.css",result.css)